//
//  HomeTabBarController.m
//  DailyGram
//
//  Created by TiOluwa Olarewaju on 9/1/12.
//  Copyright (c) 2012 MT. All rights reserved.
//

#import "HomeTabBarController.h"

@interface HomeTabBarController ()

@end

@implementation HomeTabBarController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
    if ([segue.identifier isEqualToString:@"login"])
	{
        UINavigationController * nv = segue.destinationViewController;
		LoginViewController *login = [[nv viewControllers]objectAtIndex:0];
        login.delegate = self;
                
	}
}

-(void)didLogin:(id)sender{
    
}

-(void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    if (![PFUser currentUser]) {
        [self performSegueWithIdentifier:@"login" sender:self];
    }
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
